package org.nlp2rdf.navigator.component.search;

import java.util.List;

import org.nlp2rdf.navigator.client.common.ExampleDTO;
import org.nlp2rdf.navigator.client.common.SearchDescriptorDTO;
import org.nlp2rdf.navigator.client.exception.NKEQueryException;
import org.nlp2rdf.navigator.component.IComponent;

public interface ISearch extends IComponent {

	public SearchDescriptorDTO getSearchDescriptor();

	public class Result {

		public final String uri;
		public final String label;
		public final String comment;

		public Result(String uri, String label, String comment) {
			super();
			this.uri = uri;
			this.label = label;
			this.comment = comment;
		}

		@Override
		public String toString() {
			return uri + " LABEL: " + label + " COMMENT: " + comment;
		}

	}

	/**
	 * use public List<Result> search(String search, int nrOfResults) throws
	 * NKEQueryException get a list of examples found by the search
	 * 
	 * 
	 * @param search
	 * @param nrOfResults
	 * @return
	 * @throws NKEQueryException
	 */
	@Deprecated
	public List<ExampleDTO> searchOld(String search, int nrOfResults) throws NKEQueryException;

	/**
	 * get a list of examples found by the search
	 * 
	 * @param search
	 * @param nrOfResults
	 * @return
	 * @throws NKEQueryException
	 */
	public List<Result> search(String search, int nrOfResults) throws NKEQueryException;

	/**
	 * This method proposes negative examples, which can be quite useful,
	 * CURRENTLY however there are no good implementations and the method will
	 * just return null TODO implement something that makes sense ;)
	 * 
	 * @param search
	 * @param nrOfResults
	 * @return null, if not implemented
	 * @throws NKEQueryException
	 */
	public List<ExampleDTO> getNegatives(String search, int nrOfResults) throws NKEQueryException;

}
